﻿package mortal.game.proxy
{
    import Engine.RMI.*;
    import Framework.Util.*;
    import Message.Game.*;
    import Message.Public.*;
    import extend.language.*;
    import flash.geom.*;
    import flash.utils.*;
    import mortal.common.error.*;
    import mortal.component.gconst.*;
    import mortal.game.cache.*;
    import mortal.game.events.*;
    import mortal.game.manager.*;
    import mortal.game.manager.msgTip.*;
    import mortal.game.mvc.*;
    import mortal.game.resource.*;
    import mortal.game.scene3D.layer3D.utils.*;
    import mortal.game.view.common.display.*;
    import mortal.game.view.common.guide.*;
    import mortal.game.view.common.item.*;
    import mortal.game.view.guild.redPack.*;
    import mortal.mvc.core.*;

    public class GuildProxy extends Proxy
    {
        private var _purpose:String = null;
        private var _searchStartIndex:int;
        private var _dealInviteGuildID:int;
        private var _oprateID:int;
        private var _pos:int;
        private var _member:SGuildMember;
        private var _uiddd:String;
        private var _donateMoney:Dictionary;
        private var _toPlayerId:int;
        private var _uid:String;
        private var _applyMoney:Dictionary;
        private var _lastGetPosInfoDate:Number = 0;

        public function GuildProxy()
        {
            return;
        }// end function

        public function createGuild(param1:int, param2:String, param3:String) : void
        {
            var createGuildfail:Function;
            var mode:* = param1;
            var name:* = param2;
            var purpose:* = param3;
            createGuildfail = function (param1:Exception) : void
            {
                if (mode == ECreate._ECreateFirst2Times)
                {
                    NetDispatcher.dispatchCmd(ServerCommand.GUILD_CREATE_FAIL, true);
                }
                RMIDispatcher.getInstance().dispatchErrorEvent(param1);
                return;
            }// end function
            ;
            rmi.iGuild.createGuild_async(new AMI_IGuild_createGuild(this.createGuildSuccess, createGuildfail), 0, new ECreate(mode), name, purpose);
            return;
        }// end function

        private function createGuildSuccess(param1:AMI_IGuild_createGuild, param2:int) : void
        {
            cache.guild.selfGuildInfo.setGuildID(param2);
            MsgManager.showRollTipsMsg(Language.getString(20552));
            NetDispatcher.dispatchCmd(ServerCommand.GUILD_CREATE, null);
            return;
        }// end function

        public function disbandGuild() : void
        {
            rmi.iGuild.disbandGuild_async(new AMI_IGuild_disbandGuild(this.disbandGuildSuccess));
            return;
        }// end function

        private function disbandGuildSuccess(param1:AMI_IGuild_disbandGuild) : void
        {
            cache.guild.selfGuildInfo.disbandGuild();
            MsgManager.showRollTipsMsg(Language.getString(20553));
            NetDispatcher.dispatchCmd(ServerCommand.GUILD_DISBAND, null);
            return;
        }// end function

        public function changeGuildName(param1:String) : void
        {
            rmi.iGuild.updateGuildName_async(new AMI_IGuild_updateGuildName(this.changeGuildNameSuccess), param1);
            return;
        }// end function

        private function changeGuildNameSuccess(param1:AMI_IGuild_updateGuildName) : void
        {
            MsgManager.showRollTipsMsg(Language.getString(20554));
            NetDispatcher.dispatchCmd(ServerCommand.GUILD_INFO_UPDATE, null);
            Dispatcher.dispatchEvent(new DataEvent(EventName.GuildNewChangeNameSuccess));
            return;
        }// end function

        public function changeGuildPurpose(param1:String) : void
        {
            this._purpose = param1;
            rmi.iGuild.changeGuildPurpose_async(new AMI_IGuild_changeGuildPurpose(this.changeGuildPurposeSuccess), 0, param1);
            return;
        }// end function

        private function changeGuildPurposeSuccess(param1:AMI_IGuild_changeGuildPurpose) : void
        {
            MsgManager.showRollTipsMsg(Language.getString(20555));
            cache.guild.selfGuildInfo.baseInfo.purpose = this._purpose;
            NetDispatcher.dispatchCmd(ServerCommand.GUILD_INFO_UPDATE, null);
            return;
        }// end function

        public function changeYYQQ(param1:int, param2:String) : void
        {
            var _loc_3:Object = {};
            _loc_3.operType = param1;
            _loc_3.numStr = param2;
            rmi.iGuild.changeYYQQ_async(new AMI_IGuild_changeYYQQ(this.changeYYQQSuccess, null, _loc_3), new EOperOption(param1), param2);
            return;
        }// end function

        private function changeYYQQSuccess(param1:AMI_IGuild_changeYYQQ) : void
        {
            if (param1.userObject.operType == EOperOption._EOperOptionQQ)
            {
                MsgManager.showRollTipsMsg(Language.getString(20556));
                cache.guild.selfGuildInfo.baseInfo.QQ = param1.userObject.numStr;
            }
            else
            {
                MsgManager.showRollTipsMsg(Language.getString(20557));
                cache.guild.selfGuildInfo.baseInfo.YY = param1.userObject.numStr;
            }
            NetDispatcher.dispatchCmd(ServerCommand.GUILD_INFO_UPDATE, null);
            return;
        }// end function

        public function getGuildInfo(param1:int) : void
        {
            rmi.iGuild.getGuildInfo_async(new AMI_IGuild_getGuildInfo(this.getGuildInfoSuccess), param1);
            return;
        }// end function

        private function getGuildInfoSuccess(param1:AMI_IGuild_getGuildInfo, param2:SGuildInfo) : void
        {
            if (param2.guildId == cache.guild.selfGuildInfo.guildID)
            {
                cache.guild.selfGuildInfo.syncBaseInfo(param2);
            }
            else
            {
                cache.guild.otherGuildInfo = param2;
            }
            NetDispatcher.dispatchCmd(ServerCommand.GUILD_INFO_UPDATE, null);
            return;
        }// end function

        public function searchGuilds(param1:int, param2:String, param3:int, param4:Boolean) : void
        {
            this._searchStartIndex = param3;
            rmi.iGuild.searchGuilds_async(new AMI_IGuild_searchGuilds(this.searchGuildsSuccess), param1, param2, param3, param4);
            return;
        }// end function

        private function searchGuildsSuccess(param1:AMI_IGuild_searchGuilds, param2:int, param3:int, param4:Array) : void
        {
            cache.guild.syncList(this._searchStartIndex, param3, param4);
            if (cache.guild.selfGuildInfo.selfHasJoinGuild && cache.guild.selfGuildInfo.baseInfo)
            {
                cache.guild.selfGuildInfo.baseInfo.rank = param2;
            }
            NetDispatcher.dispatchCmd(ServerCommand.GUILD_LIST_UPDATE, null);
            return;
        }// end function

        public function applyGuild(param1:int) : void
        {
            rmi.iGuild.applyGuild_async(new AMI_IGuild_applyGuild(this.applyGuildSuccess), 0, param1);
            return;
        }// end function

        private function applyGuildSuccess(param1:AMI_IGuild_applyGuild) : void
        {
            MsgManager.showRollTipsMsg(Language.getString(20558));
            NetDispatcher.dispatchCmd(ServerCommand.GuildApplySuccess, null);
            return;
        }// end function

        public function applyPlayersGuild(param1:int) : void
        {
            rmi.iGuild.applyPlayersGuild_async(new AMI_IGuild_applyPlayersGuild(this.applyPlayersGuildSuccess), param1);
            return;
        }// end function

        private function applyPlayersGuildSuccess(param1:AMI_IGuild_applyPlayersGuild) : void
        {
            MsgManager.showRollTipsMsg(Language.getString(20559));
            return;
        }// end function

        public function cancelApply(param1:int) : void
        {
            rmi.iGuild.cancelApply_async(new AMI_IGuild_cancelApply(this.cancelApplySuccess), param1);
            return;
        }// end function

        private function cancelApplySuccess(param1:AMI_IGuild_cancelApply) : void
        {
            MsgManager.showRollTipsMsg(Language.getString(20560));
            return;
        }// end function

        public function dealApply(param1:int, param2:Boolean) : void
        {
            rmi.iGuild.dealApply_async(new AMI_IGuild_dealApply(this.dealApplySuccess), 0, param1, param2);
            return;
        }// end function

        private function dealApplySuccess(param1:AMI_IGuild_dealApply, param2:Array) : void
        {
            var _loc_3:int = 0;
            while (_loc_3 < param2.length)
            {
                
                cache.guild.selfGuildInfo.removeApplyMember(param2[_loc_3]);
                _loc_3++;
            }
            NetDispatcher.dispatchCmd(ServerCommand.GUILD_APPLY_LIST_UPDATE, null);
            MsgManager.showRollTipsMsg(Language.getString(20560));
            return;
        }// end function

        public function invitePlayer(param1:int, param2:int) : void
        {
            if (ClockManager.instance.serverOpenDateNum < 3)
            {
                return;
            }
            rmi.iGuild.invitePlayer_async(new AMI_IGuild_invitePlayer(this.invitePlayerSuccess), 0, param1, new EInviteMode(param2));
            return;
        }// end function

        private function invitePlayerSuccess(param1:AMI_IGuild_invitePlayer) : void
        {
            MsgManager.showRollTipsMsg(Language.getString(20561));
            return;
        }// end function

        public function dealInvite(param1:int, param2:int, param3:Boolean, param4:int) : void
        {
            this._dealInviteGuildID = param2;
            rmi.iGuild.dealInvite_async(new AMI_IGuild_dealInvite(this.dealInviteSuccess), 0, param1, param2, param3, new EInviteMode(param4));
            return;
        }// end function

        private function dealInviteSuccess(param1:AMI_IGuild_dealInvite) : void
        {
            cache.guild.removeInviteInfo(this._dealInviteGuildID);
            MsgManager.showRollTipsMsg(Language.getString(20560));
            return;
        }// end function

        public function operationMember(param1:int, param2:int) : void
        {
            this._oprateID = param1;
            this._pos = param2;
            this._member = cache.guild.selfGuildInfo.getMemberById(this._oprateID);
            rmi.iGuild.memberOper_async(new AMI_IGuild_memberOper(this.operationMemberSuccess), 0, param1, new EGuildPosition(param2));
            return;
        }// end function

        private function operationMemberSuccess(param1:AMI_IGuild_memberOper) : void
        {
            var _loc_2:String = null;
            if (this._pos == EGuildPosition._EGuildNotMember)
            {
                MsgManager.showRollTipsMsg(Language.getStringByParam(20562, this._member.miniPlayer.name));
                Dispatcher.dispatchEvent(new DataEvent(EventName.Guild_warnMemberList_get));
            }
            else
            {
                _loc_2 = GameDefConfig.instance.getItem("EGuildPostion", this._pos).text;
                MsgManager.showRollTipsMsg(Language.getStringByParam(20563, this._member.miniPlayer.name, _loc_2));
                cache.guild.selfGuildInfo.changeMemberPosition(this._oprateID, this._pos);
            }
            NetDispatcher.dispatchCmd(ServerCommand.GUILD_MEMBERS_UPDATE, null);
            return;
        }// end function

        public function getApplyList(param1:int) : void
        {
            rmi.iGuild.getApplyList_async(new AMI_IGuild_getApplyList(this.getApplyListSuccess), param1);
            return;
        }// end function

        private function getApplyListSuccess(param1:AMI_IGuild_getApplyList, param2:Array) : void
        {
            cache.guild.selfGuildInfo.applyMemberList = param2;
            NetDispatcher.dispatchCmd(ServerCommand.GUILD_APPLY_LIST_UPDATE, null);
            return;
        }// end function

        public function getGuildMemberList(param1:int) : void
        {
            rmi.iGuild.getGuildPlayerInfo_async(new AMI_IGuild_getGuildPlayerInfo(this.getGuildAllPlayerInfoSuccess), param1);
            return;
        }// end function

        private function getGuildAllPlayerInfoSuccess(param1:AMI_IGuild_getGuildPlayerInfo, param2:Array) : void
        {
            cache.guild.selfGuildInfo.syncMemberList(param2);
            NetDispatcher.dispatchCmd(ServerCommand.GUILD_MEMBERS_UPDATE, null);
            return;
        }// end function

        public function getOtherGuildMemberList(param1:int) : void
        {
            cache.guild.otherGuildInfoV2.setGuildID(param1);
            rmi.iGuild.getGuildPlayerInfo_async(new AMI_IGuild_getGuildPlayerInfo(this.getOtherGuildAllPlayerInfoSuccess), param1);
            return;
        }// end function

        private function getOtherGuildAllPlayerInfoSuccess(param1:AMI_IGuild_getGuildPlayerInfo, param2:Array) : void
        {
            cache.guild.otherGuildInfoV2.syncMemberList(param2);
            Dispatcher.dispatchEvent(new DataEvent(EventName.Guild_update_findtalentpanel, null));
            return;
        }// end function

        public function levelUpGuild() : void
        {
            rmi.iGuild.updateGuild_async(new AMI_IGuild_updateGuild(this.levelUpGuildSuccess));
            return;
        }// end function

        private function levelUpGuildSuccess(param1:AMI_IGuild_updateGuild) : void
        {
            NetDispatcher.dispatchCmd(ServerCommand.GUILD_INFO_UPDATE, null);
            return;
        }// end function

        public function impeachGuildLeader() : void
        {
            rmi.iGuild.impeachGuildLeader_async(new AMI_IGuild_impeachGuildLeader(this.impeachGuildLeaderSuccess));
            return;
        }// end function

        private function impeachGuildLeaderSuccess(param1:AMI_IGuild_impeachGuildLeader, param2:Boolean) : void
        {
            if (param2)
            {
                MsgManager.showRollTipsMsg(Language.getString(20564));
            }
            else
            {
                MsgManager.showRollTipsMsg(Language.getString(20565));
            }
            return;
        }// end function

        public function antiImpeach() : void
        {
            rmi.iGuild.antiImpeach_async(new AMI_IGuild_antiImpeach(this.antiImpeachSuccess));
            return;
        }// end function

        private function antiImpeachSuccess(param1:AMI_IGuild_antiImpeach) : void
        {
            MsgManager.showRollTipsMsg(Language.getString(20566));
            return;
        }// end function

        public function exitGuild() : void
        {
            rmi.iGuild.exitGuild_async(new AMI_IGuild_exitGuild(this.exitGuildSuccess), 0);
            return;
        }// end function

        private function exitGuildSuccess(param1:AMI_IGuild_exitGuild, param2:Boolean) : void
        {
            if (param2)
            {
                cache.guild.selfGuildInfo.exitGuild();
                MsgManager.showRollTipsMsg(Language.getString(20567));
                NetDispatcher.dispatchCmd(ServerCommand.GUILD_EXIT, null);
            }
            else
            {
                MsgManager.showRollTipsMsg(Language.getString(20568));
            }
            return;
        }// end function

        public function exitGuildWithoutMsg() : void
        {
            rmi.iGuild.exitGuild_async(new AMI_IGuild_exitGuild(this.exitGuildSuccessV2), 0);
            return;
        }// end function

        private function exitGuildSuccessV2(param1:AMI_IGuild_exitGuild, param2:Boolean) : void
        {
            if (param2)
            {
                cache.guild.selfGuildInfo.exitGuild();
                NetDispatcher.dispatchCmd(ServerCommand.GUILD_EXIT, null);
            }
            return;
        }// end function

        public function getGuildList(param1:int) : void
        {
            rmi.iGuild.getGuildList_async(new AMI_IGuild_getGuildList(this.getGuildListSuccess), 0, param1);
            return;
        }// end function

        private function getGuildListSuccess(param1:AMI_IGuild_getGuildList, param2:int, param3:Array, param4:int, param5:int) : void
        {
            if (cache.guild.selfGuildInfo.selfHasJoinGuild)
            {
                cache.guild.selfGuildInfo.baseInfo.rank = param2;
            }
            cache.guild.syncList(param4, param5, param3);
            NetDispatcher.dispatchCmd(ServerCommand.GUILD_LIST_UPDATE, null);
            return;
        }// end function

        public function getWarningMemberList() : void
        {
            rmi.iGuild.getWarningMemberList_async(new AMI_IGuild_getWarningMemberList(this.getWarningMemberListSuccess), 0);
            return;
        }// end function

        private function getWarningMemberListSuccess(param1:AMI_IGuild_getWarningMemberList, param2:Array, param3:int, param4:int, param5:int, param6:int) : void
        {
            cache.guild.selfGuildInfo.warnMemberList = param2;
            cache.guild.selfGuildInfo.warnSetting.days = param3;
            cache.guild.selfGuildInfo.warnSetting.activity = param4;
            cache.guild.selfGuildInfo.warnSetting.chatTimes = param5;
            cache.guild.selfGuildInfo.warnSetting.contributionWeek = param6;
            NetDispatcher.dispatchCmd(ServerCommand.GUILD_WARN_LIST_UPDATE, null);
            return;
        }// end function

        public function setWarningCondition(param1:int, param2:int, param3:int, param4:int) : void
        {
            rmi.iGuild.setWarningCondition_async(new AMI_IGuild_setWarningCondition(this.setWarningConditionSuccess), 0, param1, param2, param3, param4);
            return;
        }// end function

        private function setWarningConditionSuccess(param1:AMI_IGuild_setWarningCondition) : void
        {
            MsgManager.showRollTipsMsg(Language.getString(20569));
            this.getWarningMemberList();
            return;
        }// end function

        public function recruit() : void
        {
            rmi.iGuild.guildRecruit_async(new AMI_IGuild_guildRecruit());
            return;
        }// end function

        public function getGuildWarehouse() : void
        {
            rmi.iGuild.getGuildWarehouse_async(new AMI_IGuild_getGuildWarehouse(this.getGuildWarehouseSuccess));
            return;
        }// end function

        private function getGuildWarehouseSuccess(param1:AMI_IGuild_getGuildWarehouse, param2:Array, param3:Dictionary) : void
        {
            cache.guild.selfGuildInfo.wareHouse.writeWarehouseItems(param2);
            cache.guild.selfGuildInfo.wareHouse.writeWarehouseMoneys(param3);
            NetDispatcher.dispatchCmd(ServerCommand.GuildWareHouseDataUpdate, null);
            return;
        }// end function

        public function applyGuildWarehouse(param1:String, param2:int, param3:Dictionary) : void
        {
            rmi.iGuild.applyGuildWarehouse_async(new AMI_IGuild_applyGuildWarehouse(this.applyGuildWarehouseSuccess), param1, param2, param3);
            return;
        }// end function

        private function applyGuildWarehouseSuccess(param1:AMI_IGuild_applyGuildWarehouse) : void
        {
            MsgManager.showRollTipsMsg(Language.getString(20570));
            return;
        }// end function

        public function cancelApplyGuildWarehouse(param1:String, param2:Dictionary) : void
        {
            this._uiddd = param1;
            this._donateMoney = param2;
            rmi.iGuild.cancelApplyGuildWarehouse_async(new AMI_IGuild_cancelApplyGuildWarehouse(this.cancelApplyGuildWarehouseSuccess), param1, param2);
            return;
        }// end function

        private function cancelApplyGuildWarehouseSuccess(param1:AMI_IGuild_cancelApplyGuildWarehouse) : void
        {
            MsgManager.showRollTipsMsg(Language.getString(20571));
            cache.guild.selfGuildInfo.wareHouse.removeMyAplly(this._uiddd, this._donateMoney);
            NetDispatcher.dispatchCmd(ServerCommand.GuildWareHouseMyApplysUpdate, null);
            return;
        }// end function

        public function dealGuildWarehouseApply(param1:Boolean, param2:int, param3:String, param4:Dictionary) : void
        {
            this._toPlayerId = param2;
            this._uid = param3;
            this._applyMoney = param4;
            rmi.iGuild.dealGuildWarehouseApply_async(new AMI_IGuild_dealGuildWarehouseApply(this.dealGuildWarehouseApplySuccess), param1, param2, param3, param4);
            return;
        }// end function

        private function dealGuildWarehouseApplySuccess(param1:AMI_IGuild_dealGuildWarehouseApply) : void
        {
            MsgManager.showRollTipsMsg(Language.getString(20572));
            cache.guild.selfGuildInfo.wareHouse.removeAplly(this._toPlayerId, this._uid, this._applyMoney);
            NetDispatcher.dispatchCmd(ServerCommand.GuildWareHouseAllApplysUpdate, null);
            return;
        }// end function

        public function guildWarehouseOper(param1:EGuildWarehouseOper, param2:Array, param3:Dictionary) : void
        {
            var guildWarehouseOperSuccess:Function;
            var oper:* = param1;
            var item:* = param2;
            var oprMoney:* = param3;
            guildWarehouseOperSuccess = function (param1:AMI_IGuild_guildWarehouseOper) : void
            {
                if (oper.value() == EGuildWarehouseOper._EGuildWarehouseIn)
                {
                    MsgManager.showRollTipsMsg(Language.getString(20573));
                }
                else if (oper.value() == EGuildWarehouseOper._EGuildWarehouseAllocation)
                {
                    MsgManager.showRollTipsMsg(Language.getString(20574));
                    NetDispatcher.dispatchCmd(ServerCommand.GuildWarehouseAllocationSuccess, null);
                }
                else
                {
                    MsgManager.showRollTipsMsg(Language.getString(20575));
                }
                return;
            }// end function
            ;
            rmi.iGuild.guildWarehouseOper_async(new AMI_IGuild_guildWarehouseOper(guildWarehouseOperSuccess), oper, item, oprMoney);
            return;
        }// end function

        public function getGuildWarehouseRecord() : void
        {
            rmi.iGuild.getGuildWarehouseRecord_async(new AMI_IGuild_getGuildWarehouseRecord(this.getGuildWarehouseRecordSuccess));
            return;
        }// end function

        private function getGuildWarehouseRecordSuccess(param1:AMI_IGuild_getGuildWarehouseRecord, param2:Array) : void
        {
            cache.guild.selfGuildInfo.wareHouse.writeRecordVec(param2);
            NetDispatcher.dispatchCmd(ServerCommand.GuildWareHouseRecordsUpdate, null);
            return;
        }// end function

        public function getGuildWarehouseApplys() : void
        {
            rmi.iGuild.getGuildWarehouseApplys_async(new AMI_IGuild_getGuildWarehouseApplys(this.getGuildWarehouseApplysSuccess));
            return;
        }// end function

        private function getGuildWarehouseApplysSuccess(param1:AMI_IGuild_getGuildWarehouseApplys, param2:Array) : void
        {
            cache.guild.selfGuildInfo.wareHouse.writeAllApplyList(param2);
            NetDispatcher.dispatchCmd(ServerCommand.GuildWareHouseAllApplysUpdate, null);
            return;
        }// end function

        public function getMyWarehouseApplys() : void
        {
            rmi.iGuild.getMyWarehouseApplys_async(new AMI_IGuild_getMyWarehouseApplys(this.getMyWarehouseApplysSuccess));
            return;
        }// end function

        private function getMyWarehouseApplysSuccess(param1:AMI_IGuild_getMyWarehouseApplys, param2:Array) : void
        {
            cache.guild.selfGuildInfo.wareHouse.writeMyApplyList(param2);
            NetDispatcher.dispatchCmd(ServerCommand.GuildWareHouseMyApplysUpdate, null);
            return;
        }// end function

        public function getGuildShopItems() : void
        {
            rmi.iGuild.getGuildShopItems_async(new AMI_IGuild_getGuildShopItems(this.getItemSuccess));
            return;
        }// end function

        private function getItemSuccess(param1:AMI_IGuild_getGuildShopItems, param2:Array) : void
        {
            cache.guild.selfGuildInfo.shop.itemsArr = param2;
            NetDispatcher.dispatchCmd(ServerCommand.GuildShopGetItem, null);
            return;
        }// end function

        public function buyGuildShopItem(param1:int, param2:int) : void
        {
            rmi.iGuild.buyGuildShopItem_async(new AMI_IGuild_buyGuildShopItem(this.buySuccess), param1, param2);
            return;
        }// end function

        private function buySuccess(param1:AMI_IGuild_buyGuildShopItem) : void
        {
            this.getGuildShopItems();
            return;
        }// end function

        public function donateResource(param1:SPlayerItem, param2:Dictionary) : void
        {
            rmi.iGuild.donateMoney_async(new AMI_IGuild_donateMoney(this.donateResourceSuccess, this.donateResourceFail), param1, param2);
            return;
        }// end function

        private function donateResourceSuccess(param1:AMI_IGuild_donateMoney, param2:int) : void
        {
            MsgManager.showRollTipsMsg(Language.getString(20573));
            return;
        }// end function

        private function donateResourceFail(param1:Exception) : void
        {
            MsgManager.showMouseMsg(ErrorCode.getErrorStringByCode(param1.code), MsgRollTipsType.msgRollTips3);
            return;
        }// end function

        public function fixGuildStructure(param1:EGuildStructureType) : void
        {
            rmi.iGuild.fixGuildStructure_async(new AMI_IGuild_fixGuildStructure(this.fixGuildStructureSuccess), param1);
            return;
        }// end function

        private function fixGuildStructureSuccess(param1:AMI_IGuild_fixGuildStructure) : void
        {
            return;
        }// end function

        public function stopFixGuildStructure(param1:EGuildStructureType) : void
        {
            rmi.iGuild.stopFixGuildStructure_async(new AMI_IGuild_stopFixGuildStructure(this.stopFixGuildStructureSuccess), param1);
            return;
        }// end function

        private function stopFixGuildStructureSuccess(param1:AMI_IGuild_stopFixGuildStructure) : void
        {
            return;
        }// end function

        public function learnSchoolSkill(param1:int) : void
        {
            rmi.iGuild.learnSchoolSkill_async(new AMI_IGuild_learnSchoolSkill(this.learnSchoolSkillSuccess), param1);
            return;
        }// end function

        private function learnSchoolSkillSuccess(param1:AMI_IGuild_learnSchoolSkill) : void
        {
            return;
        }// end function

        public function openGuildCopy(param1:int) : void
        {
            rmi.iGuild.openGuildBossCopy_async(new AMI_IGuild_openGuildBossCopy(), param1);
            return;
        }// end function

        public function getGuildActivity() : void
        {
            rmi.iGuild.getGuildActivity_async(new AMI_IGuild_getGuildActivity());
            return;
        }// end function

        public function sendGuildMail(param1:Array, param2:String, param3:String) : void
        {
            rmi.iGuild.sendGuildMail_async(new AMI_IGuild_sendGuildMail(this.sendGuildMailSuccess), param1, param2, param3);
            return;
        }// end function

        private function sendGuildMailSuccess(param1:AMI_IGuild_sendGuildMail) : void
        {
            MsgManager.showRollTipsMsg(Language.getString(20576));
            NetDispatcher.dispatchCmd(ServerCommand.GuildMailSendSuccess, null);
            return;
        }// end function

        public function setApplyCondition(param1:SGuildApplyCondition) : void
        {
            rmi.iGuild.setApplyCondition_async(new AMI_IGuild_setApplyCondition(this.setApplyConditionSuccess), 0, param1);
            return;
        }// end function

        private function setApplyConditionSuccess(param1:AMI_IGuild_setApplyCondition) : void
        {
            MsgManager.showRollTipsMsg(Language.getString(20577));
            return;
        }// end function

        public function upgradeCamp(param1:EUpgradeMode) : void
        {
            rmi.iGuild.upgradeCamp_async(new AMI_IGuild_upgradeCamp(this.upgradeCampSuccess), 0, param1);
            return;
        }// end function

        private function upgradeCampSuccess(param1:AMI_IGuild_upgradeCamp) : void
        {
            MsgManager.showRollTipsMsg(Language.getString(20578));
            return;
        }// end function

        public function getActivityReward() : void
        {
            var getActivityRewardSuccess:Function;
            getActivityRewardSuccess = function (param1:AMI_IGuild_getActivityReward) : void
            {
                cache.guild.selfGuildInfo.selfInfo.getReward = 1;
                NetDispatcher.dispatchCmd(ServerCommand.GUILD_INFO_UPDATE, null);
                return;
            }// end function
            ;
            rmi.iGuild.getActivityReward_async(new AMI_IGuild_getActivityReward(getActivityRewardSuccess));
            return;
        }// end function

        public function getGuildTreeBuff(param1:int) : void
        {
            var guildTreeBuffSuccess:Function;
            var buffId:* = param1;
            guildTreeBuffSuccess = function (param1:AMI_IGuild_getGuildTreeBuff) : void
            {
                AutoGuideRedPoint.instance.setValueByName(AutoGuideRedPoint.GuildGodTree, false);
                Dispatcher.dispatchEvent(new DataEvent(EventName.AutoGuideRedPointRefresh));
                return;
            }// end function
            ;
            rmi.iGuild.getGuildTreeBuff_async(new AMI_IGuild_getGuildTreeBuff(guildTreeBuffSuccess), buffId);
            return;
        }// end function

        public function getGuildParticipationInfo() : void
        {
            var getGuildParticipationInfoSuccess:Function;
            getGuildParticipationInfoSuccess = function (param1:AMI_IGuild_getGuildParticipationInfo, param2:Array) : void
            {
                NetDispatcher.dispatchCmd(ServerCommand.GuildParticipationInfoRes, param2);
                return;
            }// end function
            ;
            rmi.iGuild.getGuildParticipationInfo_async(new AMI_IGuild_getGuildParticipationInfo(getGuildParticipationInfoSuccess));
            return;
        }// end function

        public function openGuildWinePartyCopy(param1:int) : void
        {
            var openWinePartySucc:Function;
            var wineLevel:* = param1;
            openWinePartySucc = function (param1:AMI_IGuild_openGuildWinePartyCopy) : void
            {
                return;
            }// end function
            ;
            rmi.iGuild.openGuildWinePartyCopy_async(new AMI_IGuild_openGuildWinePartyCopy(openWinePartySucc), wineLevel);
            return;
        }// end function

        public function winePartyToastStart(param1:SEntityId, param2:int) : void
        {
            var wineToastSucc:Function;
            var entityId:* = param1;
            var wineType:* = param2;
            wineToastSucc = function (param1:AMI_IGuild_winePartyToastStart) : void
            {
                NetDispatcher.dispatchCmd(ServerCommand.winePartyToastSucc, wineType);
                return;
            }// end function
            ;
            rmi.iGuild.winePartyToastStart_async(new AMI_IGuild_winePartyToastStart(wineToastSucc), entityId, wineType);
            return;
        }// end function

        public function winePartyToastEnd(param1:SEntityId, param2:int = 0) : void
        {
            rmi.iGuild.winePartyToastEnd_async(new AMI_IGuild_winePartyToastEnd(), param1, param2);
            return;
        }// end function

        public function getWinePartyDonateList() : void
        {
            var getDonateListSucc:Function;
            getDonateListSucc = function (param1:AMI_IGuild_getWinePartyDonateList, param2:Array) : void
            {
                NetDispatcher.dispatchCmd(ServerCommand.WinePartyGetDonateList, param2);
                return;
            }// end function
            ;
            rmi.iGuild.getWinePartyDonateList_async(new AMI_IGuild_getWinePartyDonateList(getDonateListSucc));
            return;
        }// end function

        public function startMora(param1:SEntityId) : void
        {
            rmi.iGuild.startMora_async(new AMI_IGuild_startMora(), param1);
            return;
        }// end function

        public function showMora(param1:SEntityId, param2:int, param3:int) : void
        {
            rmi.iGuild.showMora_async(new AMI_IGuild_showMora(), param1, EWineMoraType.convert(param2), param3);
            return;
        }// end function

        public function endMora(param1:SEntityId) : void
        {
            rmi.iGuild.endMora_async(new AMI_IGuild_endMora(), param1);
            return;
        }// end function

        public function giveRedEnvelope(param1:int = 0, param2:int = 0, param3:int = 0) : void
        {
            rmi.iGuild.giveRedEnvelope_async(new AMI_IGuild_giveRedEnvelope(), param1, param2, param3);
            return;
        }// end function

        public function repostRedEnvelope(param1:int) : void
        {
            rmi.iGuild.repostRedEnvelope_async(new AMI_IGuild_repostRedEnvelope(), param1);
            return;
        }// end function

        public function robRedEnvelope(param1:int) : void
        {
            rmi.iGuild.robRedEnvelope_async(new AMI_IGuild_robRedEnvelope(this.RobSuccess, null), param1);
            return;
        }// end function

        private function RobSuccess(param1:AMI_IGuild_robRedEnvelope, param2:SRedEnvelopeInfo) : void
        {
            NetDispatcher.dispatchCmd(ServerCommand.RedPacketGetResult, param2);
            return;
        }// end function

        public function getRedEnvelopeInfo(param1:int) : void
        {
            rmi.iGuild.getRedEnvelopeInfo_async(new AMI_IGuild_getRedEnvelopeInfo(this.getInfoSuccess), param1);
            return;
        }// end function

        private function getInfoSuccess(param1:AMI_IGuild_getRedEnvelopeInfo, param2:SRedEnvelopeInfo) : void
        {
            var _loc_4:int = 0;
            var _loc_5:String = null;
            var _loc_6:Boolean = false;
            var _loc_7:String = null;
            var _loc_3:* = Cache.instance.redPackCache.redPackState;
            if (_loc_3 == RedPackStateType.CanGive || _loc_3 == RedPackStateType.RedPackSelfGive || _loc_3 == RedPackStateType.SelfeSetRedPack)
            {
                if (EntityUtil.equal(param2.boss.entityId, cache.role.entityInfo.entityId))
                {
                    if (param2.type == 0)
                    {
                        Cache.instance.redPackCache.guildRedEnvelopeInfo = param2;
                    }
                    else if (param2.type == 1)
                    {
                        Cache.instance.redPackCache.selfRedEnvelopeInfo = param2;
                    }
                }
            }
            else if (_loc_3 == RedPackStateType.RedPackOpen)
            {
                if (param2.type == 2)
                {
                    if (param2.boss == null)
                    {
                        param2.boss = new SMiniPlayer();
                    }
                    param2.boss.name = Language.getString(35635);
                }
                _loc_5 = Cache.instance.role.entityInfo.name;
                for (_loc_7 in param2.robInfos)
                {
                    
                    if (_loc_5 == _loc_7)
                    {
                        _loc_6 = true;
                    }
                    _loc_4++;
                }
                if (_loc_6)
                {
                    Cache.instance.redPackCache.redPackState = RedPackStateType.HasGot;
                }
                else if (_loc_4 >= param2.redCount)
                {
                    Cache.instance.redPackCache.redPackState = RedPackStateType.HasNotGet;
                }
                else
                {
                    Cache.instance.redPackCache.redPackState = RedPackStateType.RedPackOpen;
                }
            }
            NetDispatcher.dispatchCmd(ServerCommand.RedPacketShowGetInfo, param2);
            return;
        }// end function

        public function openGuildDefenseCopy(param1:int) : void
        {
            rmi.iGuild.openGuildDefenseCopy_async(new AMI_IGuild_openGuildDefenseCopy(), param1);
            return;
        }// end function

        public function getDayReward() : void
        {
            var getActivityRewardSuccess:Function;
            getActivityRewardSuccess = function (param1:AMI_IGuild_getAward) : void
            {
                MsgManager.showRollTipsMsg(Language.getString(20579));
                return;
            }// end function
            ;
            rmi.iGuild.getAward_async(new AMI_IGuild_getAward(getActivityRewardSuccess));
            return;
        }// end function

        public function betGuildItem(param1:int, param2:int) : void
        {
            rmi.iGuild.betGuildItem_async(new AMI_IGuild_betGuildItem(), param1, param2);
            return;
        }// end function

        public function diceGuildItem(param1:int, param2:int) : void
        {
            rmi.iGuild.diceGuildItem_async(new AMI_IGuild_diceGuildItem(), param1, param2);
            return;
        }// end function

        public function getGuildMercenaryInfo(param1:int) : void
        {
            rmi.iGuild.getGuildMercenaryInfo_async(new AMI_IGuild_getGuildMercenaryInfo(this.getGuildMercenaryInfoSuccess), param1);
            return;
        }// end function

        private function getGuildMercenaryInfoSuccess(param1:AMI_IGuild_getGuildMercenaryInfo, param2:SGuildMercenarys) : void
        {
            Cache.instance.guild.selfGuildInfo.mercenaryMoney = param2.myMoney;
            Cache.instance.guild.selfGuildInfo.setMercenaryInfo(param2.guildMercenary);
            NetDispatcher.dispatchCmd(ServerCommand.GuildNewGetMercenaryInfoBack, null);
            return;
        }// end function

        public function registerMyMercenary(param1:int) : void
        {
            rmi.iGuild.registerMyMercenary_async(new AMI_IGuild_registerMyMercenary(), param1);
            return;
        }// end function

        public function getMainCityPostionInfo() : void
        {
            var _loc_1:* = ClockManager.instance.nowDate;
            if (this._lastGetPosInfoDate == 0 || _loc_1.time - this._lastGetPosInfoDate >= 3000)
            {
                this._lastGetPosInfoDate = _loc_1.time;
                rmi.iGuild.getMainCityPositonInfo_async(new AMI_IGuild_getMainCityPositonInfo(this.getPostInfoSucess));
            }
            else
            {
                NetDispatcher.dispatchCmd(ServerCommand.MainCityPostionInfoGet, null);
            }
            return;
        }// end function

        private function getPostInfoSucess(param1:AMI_IGuild_getMainCityPositonInfo, param2:SMainCityPositons) : void
        {
            Cache.instance.mainCity.sMainCityPositons = param2;
            NetDispatcher.dispatchCmd(ServerCommand.MainCityPostionInfoGet, null);
            return;
        }// end function

        public function postionOper(param1:int, param2:SMiniPlayer, param3:int) : void
        {
            var _loc_4:Object = {player:param2, pos:param3};
            rmi.iGuild.positonOper_async(new AMI_IGuild_positonOper(this.postionOperSceuss, null, _loc_4), param1, param2.entityId.id, EMainCityPosition.convert(param3));
            return;
        }// end function

        private function postionOperSceuss(param1:AMI_IGuild_positonOper) : void
        {
            var _loc_2:* = param1.userObject;
            Cache.instance.mainCity.updatePostion(_loc_2.player, _loc_2.pos);
            NetDispatcher.dispatchCmd(ServerCommand.MainCityPostionInfoGet, null);
            MsgManager.showRollTipsMsg(Language.getString(20580));
            return;
        }// end function

        public function getBlackMarketConfig() : void
        {
            rmi.iGuild.getBlackMarketConfig_async(new AMI_IGuild_getBlackMarketConfig());
            return;
        }// end function

        public function buyItemFromBlackMarket(param1:int, param2:int, param3:int, param4:BaseItem) : void
        {
            var buySellItemSuccess:Function;
            var version:* = param1;
            var itemCode:* = param2;
            var amount:* = param3;
            var item:* = param4;
            buySellItemSuccess = function (param1:AMI_IGuild_buyItemFromBlackMarket) : void
            {
                var _loc_3:Point = null;
                var _loc_2:* = param1.userObject as BaseItem;
                if (_loc_2)
                {
                    _loc_3 = _loc_2.localToGlobal(GameConst.yellowPoint);
                    FlyToNavbarTool.flyBitmapOriginalToPack(_loc_2.bitmapdata, _loc_3);
                }
                return;
            }// end function
            ;
            rmi.iGuild.buyItemFromBlackMarket_async(new AMI_IGuild_buyItemFromBlackMarket(buySellItemSuccess, null, item), version, itemCode, amount);
            return;
        }// end function

        public function getEveryDayProfit() : void
        {
            rmi.iGuild.getEveryDayProfit_async(new AMI_IGuild_getEveryDayProfit(this.getEveryDayProfitSuccess));
            return;
        }// end function

        private function getEveryDayProfitSuccess(param1:AMI_IGuild_getEveryDayProfit) : void
        {
            NetDispatcher.dispatchCmd(ServerCommand.CityTaxHasRwBack, null);
            return;
        }// end function

        public function getMainCityRevenueInfo() : void
        {
            rmi.iGuild.getMainCityRevenueInfo_async(new AMI_IGuild_getMainCityRevenueInfo(this.getMainCityRevenueInfoSuccess));
            return;
        }// end function

        private function getMainCityRevenueInfoSuccess(param1:AMI_IGuild_getMainCityRevenueInfo, param2:SMainCityRevenueMsg) : void
        {
            cache.mainCity.revenueInfo = param2;
            NetDispatcher.dispatchCmd(ServerCommand.MainCityRevenueInfoGot, param2);
            return;
        }// end function

    }
}
